<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    //
    static function json($data,$code=1000,$message="success"){
        $data = [
            "code"=>$code,
            "message"=>$message,
            "data"=>$data
        ];
        return response($data, 200)
            ->header('Content-Type', 'text/json')
            ->header('Access-Control-Allow-Origin', '*')->send();
    }
}
